<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="../../layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="../../css/public.css">
</head>

<body>
	<div class="layui-form">
		<blockquote class="tableHead layui-elem-quote quoteBox mod_default_box">
			<form class="layui-form layui-inline">
				<div class="layui-inline" style="float:right;">
					<a class="layui-btn" data-type="edit">添加活动</a>
				</div>
			</form>
		</blockquote>

		<table id="tableList" class="layui-table" lay-filter="tableList" lay-skin="line"
			lay-data="{url:baseUrl('gameLottery'), cellMinWidth: 150, cellMaxWidth: 200, id: 'tableListTable', page:true, limits: [30, 50, 100]}">
			<thead>
				<tr>
					<th lay-data="{field:'name'}">活动名称</th>
					<th lay-data="{width: 100,field:'price'}">票价</th>
					<th lay-data="{width: 100,field:'circulation'}">发行量</th>
					<th lay-data="{width: 120,templet: '#templetZT'}">状态</th>
					<th lay-data="{width: 180,templet: '#templetDT1'}">报名截止</th>
					<th lay-data="{width: 180,templet: '#templetDT2'}">开奖时间</th>
					<th lay-data="{width: 220,templet: '#tableListBar'}">操作</th>
				</tr>
			</thead>
		</table>

		<!--模板-->
		<script type="text/html" id="templetZT">
			{{# if(d.state==3){  }}						
					<div style="color:gray;">已结束</div>
			{{# }else if(d.state==1){  }}				
					未上线　
			{{# }else if(d.state==2 && !js.compareDate(d.dt2)){ }}	
					待开奖　<a class="layui-btn layui-btn-xs layui-btn-warm" lay-event="lottery">开奖</a>
			{{# }else if(d.state==4 ){ }}
					停止抽奖
			{{# }else{ }}								
					<div style="color:green">进行中</div>
			{{# } }}
		</script>
		<script type="text/html" id="templetDT1">
			{{js.format_datetime(d.dt1, 'yyyy-MM-dd HH:mm:ss')}}
		</script>
		<script type="text/html" id="templetDT2">
			{{js.format_datetime(d.dt2, 'yyyy-MM-dd HH:mm:ss')}}
		</script>
		<script type="text/html" id="tableListBar">
			{{# if(d.state==1||d.state==4){  }}	
			<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
			<!-- <a class="layui-btn layui-btn-xs" lay-event="editPrize">编辑奖品</a> -->
			<a class="layui-btn layui-btn-xs layui-btn-danger"  lay-event="del">删除</a>
			{{# } else if(d.state==2){  }}
			<a class="layui-btn layui-btn-xs" lay-event="searchAwards">查看获奖名单</a>
			<a class="layui-btn layui-btn-xs" lay-event="stop">停止抽奖</a>
			{{# } else if(d.state==3){  }}
			<a class="layui-btn layui-btn-xs" lay-event="searchAwards">查看获奖名单</a>
			<a class="layui-btn layui-btn-xs layui-btn-danger"  lay-event="del">删除</a>
			{{# } }}
		</script>
		
	</div>
	<script type="text/javascript" src="../../layui/layui.js"></script>
	<script type="text/javascript" src="../../js/jsCtl.js"></script>
	<script type="text/javascript" src="index.js"></script>
</body>

</html>